﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys0a02
    {
		private string _usercode;
		private string _rolecode;
		
        /// <summary>
        /// 用户编码
        /// </summary>
		public string Usercode
		{
			get { return _usercode;	 }
			set { _usercode=value;	}
		}
        /// <summary>
        /// 组别编码
        /// </summary>
		public string Rolecode
		{
			get { return _rolecode;	 }
			set { _rolecode=value;	}
		}
		
		public static List<Sys0a02> GetSys0a02ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys0a02> list = new List<Sys0a02>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys0a02 model = GetSys0a02ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys0a02 GetSys0a02ByDataRow(DataRow dr)
		{
			Sys0a02 model = new Sys0a02(); //实例化Sys0a02
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("usercode")&&!(dr["usercode"] is System.DBNull))  
				model.Usercode = ( string)dr["usercode"];
			if (dcc.Contains("rolecode")&&!(dr["rolecode"] is System.DBNull))  
				model.Rolecode = ( string)dr["rolecode"];
			
			return model;
		}
    }
}
